//
//  UIView+MLKit.h
//
//  Created by Molon on 13/11/12.
//  Copyright (c) 2013 Molon. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (MLKit)

@property (nonatomic) CGPoint frameOrigin;
@property (nonatomic) CGSize frameSize;

@property (nonatomic) CGFloat frameX;
@property (nonatomic) CGFloat frameY;

@property (nonatomic) CGFloat frameRight;
@property (nonatomic) CGFloat frameBottom;

@property (nonatomic) CGFloat frameWidth;
@property (nonatomic) CGFloat frameHeight;

- (CGRect)midFrameWithHeight:(CGFloat)height width:(CGFloat)width;

- (BOOL)containsSubViewOfClassType:(Class)cls;
- (void)removeAllSubViews;
- (void)removeSubviewsWithSubviewClass:(Class)cls;

- (BOOL)isDescendantOfViewClass:(Class)cls;

+ (UINib *)nib;
+ (instancetype)instanceFromNib;

//简单动画  type 为kCATransitionFade等等
- (void)simpleTransitionWithDuration:(CFTimeInterval)duration andType:(NSString*)type;


/**
 *  启用圆角优化
 */
- (void)activateMLSmoothCornerWithRadius:(CGFloat)radius andBackgroundColor:(UIColor*)color andShouldRasterize:(BOOL)shouldRasterize;

//设置layer背景色
- (void)setLayerBackgroundColor:(UIColor*)color;
- (void)setLayerShouldRasterize:(BOOL)shouldRasterize;

//badge
- (UIView *)showBadgeValue:(NSString *)strBadgeValue;
- (UIView *)showBadgeValue:(NSString *)strBadgeValue offset:(CGPoint)offset;
- (void)removeBadgeValue;

@end
